{{useCss "app-pages/css/goods_list.scss"}}
<div class="goods_list">
    <div class="chooselist {{$Cache.top.hidden_top&&'focus'}}">
        <href to="/goods_list.html?id=3">
            <div class="{{window.ArrayIndexOf([undefined,'3'],$Loc.current_location.query.queryHash.id)!==-1&&'focus'}}">最新上架</div>
        </href>
        <href to="/goods_list.html?id=2">
            <div class="{{$Loc.current_location.query.queryHash.id==2&&'focus'}}">销量最高</div>
        </href>
        <href event-click="{{'$Event.goods_list.show_tags'}}">
            <div class="{{$Loc.current_location.query.queryHash.id==1&&'focus'}}">分类</div>
        </href>
    </div>
    <div class="goods_list_title">
        <div class="mark"></div>
        {{$Cache.goods_list.list_title}}
    </div>

    {{#each $Cache.goods_list.goods_list}}
    <div class="listitem">
        <div class="goodsimg">
            <href to="goods_details.html?id={{_id}}">
                <img bind-src="{{preview_img_url}}?imageView/1/w/100/h/100" />
            </href>
        </div>
        <div class="goodsinfo">
            <href to="goods_details.html?id={{_id}}">
                <div class="name">{{goods_name+" "}}
                    <span class="detail">{{intro}}</span>
                </div>
            </href>
            <div class="sale">
                <div class="sitem">
                    <span class="price">￥{{price}}</span>
                </div>
                <div class="sitem">库存：{{num}}</div>
            </div>
        </div>
    </div>
    {{/each}}

    <div class="getmore">
        {{#if $State.goods_list.loading_goods}}
        <p>正在加载</p>
        {{#else}} 
            {{#if $State.goods_list.has_more}}
            <sbutton shadownum1="0 0 10px 1px" shadownum2="0 0 6px 0" class="btn" event-click="{{'$Event.getMoreGoods'}}" text="查看更多商品"></sbutton>
            {{#else}}
            <p>没有更多东西了</p>
            {{/if}} 
        {{/if}}
    </div>
</div>
<div class="_tagbox {{$Cache.goods_list.show_tags&&'focus'}}">
    <div class="back-mark" event-click="{{'$Event.goods_list.show_tags'}}">&or;</div>
    <div class="box">
    {{#if $Cache.goods_list.tags_detail.length}}
        {{#each $Cache.goods_list.tags_detail}}
        <href class="tag_item" to="/goods_list.html?id=1&tag={{_id}}">{{tag_name}}</href>
        {{/each}}
    {{#else}}
        <p>暂无设置分类</p>
    {{/if}}
    
    </div>
</div>

